package com.linshidream.intrachat.simplenio;

import com.linshidream.intrachat.simplenio.packet.boots.PacketBootstrap;
import com.linshidream.intrachat.simplenio.packet.handler.ClientPacketHandler;
import com.linshidream.intrachat.simplenio.packet.handler.LengthFieldMessageCodec;
import com.linshidream.intrachat.simplenio.packet.handler.MessageCodec;
import com.linshidream.intrachat.simplenio.packet.handler.PacketHandler;

import java.io.IOException;

/**
 * Created on 2025/7/24 18:25
 *
 * @author linshidream
 * @version 1.0.0
 * @description
 */

public class MiniNettyClient {

    public static void main(String[] args) throws IOException {

        MessageCodec codec = new LengthFieldMessageCodec();
        PacketHandler handler = new ClientPacketHandler();

        PacketBootstrap bootstrap = new PacketBootstrap();
        bootstrap.handler(codec, handler)
                .connect("localhost", 10030)
                .async();

        bootstrap.send();
    }
}
